Skip to content

feat(loops): Make builder sessions resumable from the loops page#3745

Merged
charlesvien merged 7 commits into
mainfrom
feat/loop-builder-resume
Jul 23, 2026
Merged

feat(loops): Make builder sessions resumable from the loops page#3745
charlesvien merged 7 commits into
mainfrom
feat/loop-builder-resume

Conversation

@charlesvien

Copy link
Copy Markdown
Member

Problem

Starting the loop builder from the loops page creates an anonymous repo-less cloud task and navigates to it. Leaving that task (clicking another task, going back to Loops) left no way back: the loops page had no memory of the session and the sidebar row was titled with the raw prompt, indistinguishable from any other task.

Changes

  • Builder tasks are now titled "Loop builder: " so the sidebar row is recognizable. The chat content still gets the raw prompt.
  • Each started builder session is recorded in a persisted per-device store and shown as a "Builder in progress" row above the composer on the loops page, with a Resume button back to the task.
  • Rows only show while the cloud run is actually alive: task summaries are polled and sessions whose sandbox shut down (completed, failed, cancelled, archived or deleted task) are pruned automatically.
  • Each row has a Stop button that ends the run through the same stopCloudRun path as the task view's "Stop run" button, then removes the row.
  • useInboxCloudTaskRunner gained an onTaskCreated callback so variants can observe the created task.

How did you test this?

  • New unit tests for the session store (ordering, dedupe, cap, removal); ran the loops, inbox and scouts vitest suites.
  • pnpm --filter @posthog/ui typecheck and Biome on the touched files.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 1d5c806.

@trunk-io

trunk-io Bot commented Jul 23, 2026

Copy link
Copy Markdown

😎 This pull request was merged.

@posthog

posthog Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Visual changes approved by @charlesvien — baseline updated in 035e9f5.

View this run in PostHog

2 changed.

Comment thread packages/ui/src/features/loops/loopBuilderSessionStore.ts
@veria-ai

veria-ai Bot commented Jul 23, 2026

Copy link
Copy Markdown

PR overview

All previously flagged issues have been addressed. No open security concerns remain on this pull request.

Security review

No open security issues remain on this pull request.

Fixed/addressed: 1 · PR risk: 0/10

@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "make loop builder sessions resumable" | Re-trigger Greptile

charlesvien and others added 3 commits July 23, 2026 02:01
2 updated
Run: f8911d32-bff0-4dcb-bef3-5575a0094281

Co-authored-by: charlesvien <5378415+charlesvien@users.noreply.github.com>
@charlesvien charlesvien added the Stamphog This will request an autostamp by stamphog on small changes label Jul 23, 2026
github-actions[bot]
github-actions Bot previously approved these changes Jul 23, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Contained UI feature (resumable loop-builder sessions) with real test coverage; the one substantive review concern (cross-account prompt persistence) is verifiably fixed in the diff via identity-scoped storage and a version migration that drops unattributed legacy entries, corroborated by a bot follow-up comment. No risky-territory surface (auth, billing, migrations, CI, deps) is touched.

  • Author wrote 67% of the modified lines and has 155 merged PRs in these paths (familiarity MODERATE).
  • 👍 on the PR from greptile-apps[bot].
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 347L, 8F substantive, 538L/10F incl. docs/generated/snapshots — within ceiling
tier T1-agent / T1d-complex (538L, 10F, two-areas, feat)
stamphog 2.0.0b3 .stamphog/policy.yml @ 0092213 · reviewed head d583d63

2 updated
Run: 78b2e825-5647-4b0d-ae22-53a298a35783

Co-authored-by: charlesvien <5378415+charlesvien@users.noreply.github.com>
@stamphog
stamphog Bot dismissed github-actions[bot]’s stale review July 23, 2026 09:10

New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.

github-actions[bot]
github-actions Bot previously approved these changes Jul 23, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Contained UI feature (loop builder resumability) with no auth/billing/crypto/API/dependency/CI/migration surface touched; the one substantive security concern (cross-account prompt leakage) was verifiably fixed in the diff via per-identity scoping and a version-bump migration that drops unattributed entries, and an agent reviewer confirmed no open concerns remain.

  • Author wrote 67% of the modified lines and has 155 merged PRs in these paths (familiarity MODERATE).
  • 👍 on the PR from greptile-apps[bot].
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 347L, 8F substantive, 538L/10F incl. docs/generated/snapshots — within ceiling
tier T1-agent / T1d-complex (538L, 10F, two-areas, feat)
stamphog 2.0.0b3 .stamphog/policy.yml @ 0092213 · reviewed head 035e9f5

@stamphog
stamphog Bot dismissed github-actions[bot]’s stale review July 23, 2026 09:13

New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.

github-actions[bot]
github-actions Bot previously approved these changes Jul 23, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Contained client-side UI/feature work (loop builder session tracking) with no touch on auth, billing, migrations, dependencies, or CI; the one security concern a bot reviewer raised (cross-account prompt leakage) is verifiably fixed in the diff via per-identity scoping and a store migration that drops unattributed entries, and it's covered by new unit tests.

  • Author wrote 80% of the modified lines and has 155 merged PRs in these paths (familiarity STRONG).
  • 👍 on the PR from greptile-apps[bot].
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 347L, 9F substantive, 538L/11F incl. docs/generated/snapshots — within ceiling
tier T1-agent / T1d-complex (538L, 11F, two-areas, feat)
stamphog 2.0.0b3 .stamphog/policy.yml @ 0092213 · reviewed head a8ff0f7

@stamphog
stamphog Bot dismissed github-actions[bot]’s stale review July 23, 2026 09:19

New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Local-only UI feature (builder session resumability on the loops page) with no changes to APIs, data models, auth flows, billing, or dependencies; the one flagged privacy concern (persisted sessions leaking across accounts) is visibly fixed in this diff via per-identity scoping and a store version bump that drops unattributed legacy entries, and new unit tests cover the store and liveness logic.

  • Author wrote 21% of the modified lines and has 169 merged PRs in these paths (familiarity MODERATE).
  • 👍 on the PR from greptile-apps[bot].
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 381L, 16F substantive, 572L/18F incl. docs/generated/snapshots — within ceiling
tier T1-agent / T1d-complex (572L, 18F, two-areas, feat)
stamphog 2.0.0b3 .stamphog/policy.yml @ 0092213 · reviewed head 1d5c806

@charlesvien
charlesvien enabled auto-merge (squash) July 23, 2026 09:22
@charlesvien
charlesvien disabled auto-merge July 23, 2026 09:29
@charlesvien
charlesvien merged commit ac15077 into main Jul 23, 2026
32 checks passed
@charlesvien
charlesvien deleted the feat/loop-builder-resume branch July 23, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stamphog This will request an autostamp by stamphog on small changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant